<!--
 * @Description: 
 * @Author: Sun
 * @Date: 2019-11-22 21:36:30
 * @LastEditors: Sun
 * @LastEditTime: 2019-11-23 14:58:35 theme="ovilia-green"
 -->
<template>
  <div class="hello" >
    
    <v-chart  :options="option" />
  </div>
</template>

<script>
// import 'echarts/lib/chart/pie'
export default {
  components: {
    // "v-chart": ECharts
  },
  data() {
    return {
  option:{
    tooltip: {
        trigger: 'item',
        formatter: "{a} <br/>{b}: {c} ({d}%)"
    },
    legend: {
        orient: 'vertical',
        x: 'left',
        data:['直接访问','邮件营销','联盟广告','视频广告','搜索引擎']
    },
    series: [
        {
            name:'访问来源',
            type:'pie',
            radius: ['50%', '70%'],
            avoidLabelOverlap: false,
            label: {
                normal: {
                    show: false,
                    position: 'center'
                },
                emphasis: {
                    show: true,
                    textStyle: {
                        fontSize: '30',
                        fontWeight: 'bold'
                    }
                }
            },
            labelLine: {
                normal: {
                    show: true
                }
            },
            data:[
                {value:335, name:'直接访问'},
                {value:310, name:'邮件营销'},
                {value:234, name:'联盟广告'},
                {value:135, name:'视频广告'},
                {value:1548, name:'搜索引擎'}
            ]
        }
    ]
}

    }
  },
  mounted() {

  },
  watch: {

  }
};
</script>

<style scoped>
.hello {
  width: 500px;
  height: 500px;
}
.echarts {
  width: 100%;
  height: 100%;
}
</style>
